home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.2 KB | 108 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWRecevr.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWRECEVR_H
- #define FWRECEVR_H
-
- #ifndef FWINTERE_H
- #include "FWIntere.h"
- #endif
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- #ifndef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- //========================================================================================
- // Foward declarations
- //========================================================================================
-
- class FW_CNotification;
-
- //========================================================================================
- // CLASS FW_MReceiver
- //========================================================================================
-
- class FW_MReceiver
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_MReceiver)
-
- public:
- FW_MReceiver();
- virtual ~FW_MReceiver();
-
- virtual void HandleNotification(Environment* ev, const FW_CNotification& notification) = 0;
-
- void AddInterest(const FW_CInterest& interest);
- void AddInterest(FW_MNotifier* notifier, FW_Message message);
-
- void RemoveAllInterests();
- void RemoveInterest(const FW_CInterest& interest);
- void RemoveInterest(FW_MNotifier* notifier, FW_Message message);
-
- void Connect();
- void Disconnect();
-
- FW_Boolean IsConnected() const;
-
- FW_ObjectID PrivGetReceiverID() const;
- void PrivSetReceiverID(FW_ObjectID newID);
-
- private:
- FW_Boolean fIsConnected;
- FW_ObjectID fReceiverID;
- };
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::IsConnected
- //----------------------------------------------------------------------------------------
- inline FW_Boolean FW_MReceiver::IsConnected() const
- {
- return fIsConnected;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::AddInterest
- //----------------------------------------------------------------------------------------
- inline void FW_MReceiver::AddInterest(FW_MNotifier* notifier, FW_Message message)
- {
- AddInterest(FW_CInterest(notifier, message));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::RemoveInterest
- //----------------------------------------------------------------------------------------
- inline void FW_MReceiver::RemoveInterest(FW_MNotifier* notifier, FW_Message message)
- {
- RemoveInterest(FW_CInterest(notifier, message));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::PrivGetReceiverID
- //----------------------------------------------------------------------------------------
- inline FW_ObjectID FW_MReceiver::PrivGetReceiverID() const
- {
- return fReceiverID;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_MReceiver::PrivSetReceiverID
- //----------------------------------------------------------------------------------------
- inline void FW_MReceiver::PrivSetReceiverID(FW_ObjectID newID)
- {
- fReceiverID = newID;
- }
-
- #endif
-